import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '赛事',
    align:"center",
    dataIndex: 'sais_dictText'
   },
   {
    title: '赛区',
    align:"center",
    dataIndex: 'saiq_dictText'
   },
   {
    title: '作品',
    align:"center",
    dataIndex: 'zuop'
   },
   {
    title: '赛事进程',
    align:"center",
    dataIndex: 'saishijc_dictText'
   },
   {
    title: '状态',
    align:"center",
    dataIndex: 'zhuangt_dictText'
   },
   {
    title: '评审结果',
    align:"center",
    dataIndex: 'pingsjg_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "赛区",
      field: 'saiq',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"saiq"
      },
      //colProps: {span: 6},
 	},
	{
      label: "赛事进程",
      field: 'saishijc',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"saisjc"
      },
      //colProps: {span: 6},
 	},
	{
      label: "状态",
      field: 'zhuangt',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"zuopzt"
      },
      //colProps: {span: 6},
 	},
	{
      label: "评审结果",
      field: 'pingsjg',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"pingsjg"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '赛事',
    field: 'sais',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"cbda_sais,mingc,id"
     },
  },
  {
    label: '赛区',
    field: 'saiq',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"saiq"
     },
  },
  {
    label: '作品',
    field: 'zuop',
    component: 'Input',
  },
  {
    label: '赛事进程',
    field: 'saishijc',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"saisjc"
     },
  },
  {
    label: '状态',
    field: 'zhuangt',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"zuopzt"
     },
  },
  {
    label: '评审结果',
    field: 'pingsjg',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"pingsjg"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  sais: {title: '赛事',order: 0,view: 'list', type: 'string',dictTable: "cbda_sais", dictCode: 'id', dictText: 'mingc',},
  saiq: {title: '赛区',order: 1,view: 'list', type: 'string',dictCode: 'saiq',},
  zuop: {title: '作品',order: 2,view: 'text', type: 'string',},
  saishijc: {title: '赛事进程',order: 3,view: 'list', type: 'string',dictCode: 'saisjc',},
  zhuangt: {title: '状态',order: 4,view: 'list', type: 'string',dictCode: 'zuopzt',},
  pingsjg: {title: '评审结果',order: 5,view: 'list', type: 'string',dictCode: 'pingsjg',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}